<template>
  <div class="header">
    <div class="header_left">
      <div class="header_link">
        <svg class="icon"
             aria-hidden='true'>
          <use xlink:href="#icon-fanhui"></use>
        </svg>
      </div>
    </div>
    <div class="header_input">
      <svg class="icon header_input-icon"
           aria-hidden="true">
        <use xlink:href="#icon-sousuo"></use>
      </svg>
      输入城市景点/游玩主题</div>
    <div class="header_right">
      <router-link to='/city'>
        <div class="header_link">
          {{this.city}}
          <svg class="icon"
               aria-hidden="true">
            <use xlink:href="#icon-triangledownfill"></use>
          </svg>
        </div>
      </router-link>
    </div>
  </div>
</template>

<script>
import { mapState, mapGetters } from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city']),
    ...mapGetters(['doubleCity'])
  }
}
</script>

<style lang='scss' scoped>
/* 因为设计稿是750px,iphone6的双倍设计稿，在reset.css中将html的fs设置为50px,
* 那么 代码尺寸=实际尺寸/100
*/
// 在css中引入其他css时，使用@符号前加入~
@import '~@sass/varibles/_color';
.header {
  line-height: $header-ht;
  display: flex;
  background-color: $g-bg-c;
  color: #fff;
}
.header_left {
  width: 0.64rem;
  padding: {
    left: 0.1rem;
    right: 0.1rem;
  }
  text-align: center;
}
.header_input {
  position: relative;
  flex: 1;
  height: 0.64rem;
  line-height: 0.64rem;
  padding-left: 0.6rem;
  margin-top: 0.12rem;
  background-color: #fff;
  border-radius: 0.1rem;
  color: #ccc;
}

.header_input-icon {
  position: absolute;
  left: 0.15rem;
  top: 50%;
  transform: translateY(-50%);
}
.header_right {
  min-width: 1.24rem;
  padding: 0 0.1rem;
  text-align: center;
  .icon {
    font-size: 0.22rem;
    margin-left: -0.02rem;
  }
}
.header_link {
  color: #fff;
}
</style>
